# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-langcodes
pkgver=3.3.0
pkgrel=2
pkgdesc="Tools for labeling human languages with IETF language tags"
url="https://github.com/rspeer/langcodes"
arch="noarch"
license="MIT"
depends="py3-language-data py3-setuptools"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/l/langcodes/langcodes-$pkgver.tar.gz"
builddir="$srcdir/langcodes-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b728d951dda28cdbc20e1bb7d3ad55281c04dee09f4451ea2820d3d5ad29eb4957c7fc5b0ad5e2a6828f28284d6a4785c780931396230401c2960bbf8d7f444a  langcodes-3.3.0.tar.gz
"
